/*
    Bandleader
    Copyright (c) 2006 by Grant Yoshida

    Licensed under the GPL version 2 or later,
    please see COPYING for details.
*/

#ifndef MidiPlayer_h
#define MidiPlayer_h

#include "PtrFwd.h"
#include <QtCore/QObject>
#include <vector>

class QString;
class QTimer;

class MidiPlayer : public QObject
{
    Q_OBJECT
public:
    MidiPlayer(QObject *parent = 0);

    void load(const QString &fileName);

    void play();
    void pause();
    void stop();

    bool isPlaying() const;

    int beatCount() const;

    QTimer *playTimer() const;

signals:
    void stopped();

private slots:
    void timerTick();

private:
    MidiPerformPtr m_performance;
    bool m_playing;
    QTimer *m_playTimer;
};

#endif
